class FsetsController < ApplicationController
  # GET /fsets
  # GET /fsets.xml
  def index
    @fsets = Fset.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @fsets }
    end
  end

  # GET /fsets/1
  # GET /fsets/1.xml
  def show
    @fset = Fset.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @fset }
    end
  end

  # GET /fsets/new
  # GET /fsets/new.xml
  def new
    @fset = Fset.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @fset }
    end
  end

  # GET /fsets/1/edit
  def edit
    @fset = Fset.find(params[:id])
  end

  # POST /fsets
  # POST /fsets.xml
  def create
    @fset = Fset.new(params[:fset])

    respond_to do |format|
      if @fset.save
        flash[:notice] = 'Fset was successfully created.'
        format.html { redirect_to(@fset) }
        format.xml  { render :xml => @fset, :status => :created, :location => @fset }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @fset.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /fsets/1
  # PUT /fsets/1.xml
  def update
    @fset = Fset.find(params[:id])

    respond_to do |format|
      if @fset.update_attributes(params[:fset])
        flash[:notice] = 'Fset was successfully updated.'
        format.html { redirect_to(@fset) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @fset.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /fsets/1
  # DELETE /fsets/1.xml
  def destroy
    @fset = Fset.find(params[:id])
    @fset.destroy

    respond_to do |format|
      format.html { redirect_to(fsets_url) }
      format.xml  { head :ok }
    end
  end
end
